#ifndef COMMODITY_H
#define COMMODITY_H
#include <QList>
#include <QDebug>

class QString;

class Commodity
{
public:
    Commodity() {}
    Commodity(const Commodity &org)
    {
        m_commodityBarcode = org.m_commodityBarcode;
        m_commodityName = org.m_commodityName;
        m_internalCode = org.m_internalCode;
        m_categoryNumber = org.m_categoryNumber;
        m_specificationsNumber = org.m_specificationsNumber;
        m_colorNumber = org.m_colorNumber;
        m_brandNumbe = org.m_brandNumbe;
        m_unitNumber = org.m_unitNumber;
        m_discount = org.m_discount;
        m_shelfLife = org.m_shelfLife;
        m_cost = org.m_cost;
        m_sellingPrice = org.m_sellingPrice;
        m_realSellingPrice = org.m_realSellingPrice;
        m_memberPrice = org.m_memberPrice;
        m_stockQuantity = org.m_stockQuantity;
        m_minStock = org.m_minStock;
        m_remark = org.m_remark;
        m_purchaseQuantity = org.m_purchaseQuantity;
        m_purchaseTotal = org.m_purchaseTotal;
        m_purchaseOrderFormNumber = org.m_purchaseOrderFormNumber;
    }
    Commodity & operator =(const Commodity &other)
    {
        if (this == &other)
            return *this;
        this->m_commodityBarcode = other.get_commodityBarcode();
        this->m_commodityName = other.get_commodityName();
        this->m_internalCode = other.get_internalCode();
        this->m_categoryNumber = other.get_categoryNumber();
        this->m_specificationsNumber = other.get_specificationsNumber();
        this->m_colorNumber = other.get_colorNumber();
        this->m_brandNumbe = other.get_brandNumbe();
        this->m_unitNumber = other.get_unitNumber();
        this->m_discount = other.get_discount();
        this->m_shelfLife = other.get_shelfLife();
        this->m_cost = other.get_cost();
        this->m_sellingPrice = other.get_sellingPrice();
        this->m_realSellingPrice = other.get_realSellingPrice();
        this->m_memberPrice = other.get_memberPrice();
        this->m_stockQuantity = other.get_stockQuantity();
        this->m_minStock = other.get_minStock();
        this->m_remark = other.get_remark();
        this->m_purchaseQuantity = other.get_purchaseQuantity();
        this->m_purchaseTotal = other.get_purchaseTotal();
        this->m_purchaseOrderFormNumber = other.get_purchaseOrderFormNumber();
        return *this;
    }
    Commodity(const QString commodityBarcode, const QString commodityName, const QString internalCode,
                   const QString categoryNumber, const QString specificationsNumber, const QString colorNumber,
                   const QString brandNumbe, const QString unitNumber, const QString discount,
              const QString shelfLife, const QString cost, const QString sellingPrice,
              const QString memberPrice, const QString stockQuantity,
              const QString minStock, const QString remark)
    {
        m_commodityBarcode = commodityBarcode;
        m_commodityName = commodityName;
        m_internalCode = internalCode;
        m_categoryNumber = categoryNumber;
        m_specificationsNumber = specificationsNumber;
        m_colorNumber = colorNumber;
        m_brandNumbe = brandNumbe;
        m_unitNumber = unitNumber;
        m_discount = discount;
        m_shelfLife = shelfLife;
        m_cost = cost;
        m_sellingPrice = sellingPrice;
        m_memberPrice = memberPrice;
        m_stockQuantity = stockQuantity;
        m_minStock = minStock;
        m_remark = remark;
    }
    Commodity(const QString commodityBarcode, const QString commodityName,
              const QString internalCode, const QString unitNumber,
              const QString sellingPrice)
    {
        m_commodityBarcode = commodityBarcode;
        m_commodityName = commodityName;
        m_internalCode = internalCode;
        m_unitNumber = unitNumber;
        m_sellingPrice = sellingPrice;
    }
    Commodity(const QString commodityBarcode, const QString commodityName,
              const QString categoryNumber, const QString specificationsNumber,
              const QString colorNumber, const QString brandNumbe,
              const QString unitNumber, const QString cost,
              const QString purchaseQuantity, const QString purchaseTotal,
              const QString purchaseOrderFormNumber)
    {
        m_commodityBarcode = commodityBarcode;
        m_commodityName = commodityName;
        m_categoryNumber = categoryNumber;
        m_specificationsNumber = specificationsNumber;
        m_colorNumber = colorNumber;
        m_brandNumbe = brandNumbe;
        m_unitNumber = unitNumber;
        m_cost = cost;
        m_purchaseQuantity = purchaseQuantity;
        m_purchaseTotal = purchaseTotal;
        m_purchaseOrderFormNumber = purchaseOrderFormNumber;
    }
    Commodity(const QString commodityBarcode, const QString commodityName, const QString cost,
              const QString discount, const QString sellingPrice, const QString memberPrice,
              const QString realSellingPrice, QString stockQuantity)
    {
        m_commodityBarcode = commodityBarcode;
        m_commodityName = commodityName;
        m_cost = cost;
        m_discount = discount;
        m_sellingPrice = sellingPrice;
        m_memberPrice = memberPrice;
        m_realSellingPrice = realSellingPrice;
        m_stockQuantity = stockQuantity;
    }
    Commodity(const QString commodityBarcode, const QString realPrice, const QString discount)
    {
        m_commodityBarcode = commodityBarcode;
        m_realSellingPrice = realPrice;
        m_discount = discount;
    }

    void debugPrint()
    {
        qDebug() <<     m_commodityBarcode
        << m_commodityName
        << m_internalCode
        << m_categoryNumber
        << m_specificationsNumber
        << m_colorNumber
        << m_brandNumbe
        << m_unitNumber
        << m_discount
        << m_shelfLife
        << m_cost
        << m_sellingPrice
        << m_memberPrice
        << m_stockQuantity
        << m_minStock
        << m_remark
        << m_purchaseQuantity
        << m_purchaseTotal;
    }

    QString get_commodityBarcode() const {return m_commodityBarcode;}
    QString get_commodityName() const {return m_commodityName;}
    QString get_internalCode() const {return m_internalCode;}
    QString get_categoryNumber() const {return m_categoryNumber;}
    QString get_specificationsNumber() const {return m_specificationsNumber;}
    QString get_colorNumber() const {return m_colorNumber;}
    QString get_brandNumbe() const {return m_brandNumbe;}
    QString get_unitNumber() const {return m_unitNumber;}
    QString get_discount() const {return m_discount;}
    QString get_shelfLife() const {return m_shelfLife;}
    QString get_cost() const {return m_cost;}
    QString get_sellingPrice() const {return m_sellingPrice;}
    QString get_realSellingPrice() const {return m_realSellingPrice;}
    QString get_memberPrice() const {return m_memberPrice;}
    QString get_stockQuantity() const {return m_stockQuantity;}
    QString get_minStock() const {return m_minStock;}
    QString get_remark() const {return m_remark;}
    QString get_purchaseQuantity() const {return m_purchaseQuantity;}
    QString get_purchaseTotal() const {return m_purchaseTotal;}
    QString get_purchaseOrderFormNumber() const {return m_purchaseOrderFormNumber;}

    void set_purchaseQuantity(QString purchaseQuantity)
    {m_purchaseQuantity = purchaseQuantity;}
    void set_cost(QString cost)  {m_cost = cost;}
    void set_purchaseTotal(QString purchaseTotal)  {m_purchaseTotal = purchaseTotal;}
    void set_sellingPrice(QString sellingPrice)  {m_sellingPrice = sellingPrice;}
    void set_discount(QString discount)  {m_discount = discount;}
    void set_realSellingPrice(const QString& realSellingPrice)
    {m_realSellingPrice = realSellingPrice;}

private:
    QString m_commodityBarcode ;
    QString m_commodityName ;
    QString m_internalCode ;
    QString m_categoryNumber ;
    QString m_specificationsNumber ;
    QString m_colorNumber ;
    QString m_brandNumbe ;
    QString m_unitNumber ;
    QString m_discount ;
    QString m_shelfLife ;
    QString m_cost ;
    QString m_sellingPrice ;
    QString m_realSellingPrice ;
    QString m_memberPrice ;
    QString m_stockQuantity ;
    QString m_minStock ;
    QString m_remark ;    
    QString m_purchaseQuantity;
    QString m_purchaseTotal;
    QString m_purchaseOrderFormNumber;
//    QString m_sum;
//    QString m_staff;
//    bool integration;
};

typedef QList <Commodity> commodityList;

#endif // COMMODITY_H
